/*
package com.runfast.waimai.web.controller.company;

import com.runfast.common.utils.SessionContext;
import com.runfast.common.web.entity.Result;
import com.runfast.waimai.dao.model.*;
import com.runfast.waimai.service.BaseRoleService;
import com.runfast.waimai.service.BaseUserRoleService;
import com.runfast.waimai.service.BaseUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

*/
/**
 * ${DESCRIPTION} 其他人员管理
 *
 * @author chenzheng
 * @create 2018-05-22 10:14
 **//*

@RestController("otherUserController")
@RequestMapping("/server/otherUser")
public class OtherUserController {

    @Autowired
    private BaseUserService baseUserService;
    @Autowired
    private BaseUserRoleService baseUserRoleService;
    @Autowired
    private BaseRoleService baseRoleService;

    */
/**
     * 城市经理列表带分页的
     *//*

    @GetMapping("/list")
    public Result list(@PageableDefault Pageable pageable, Map<String, Object> params){
        BaseUser admin = SessionContext.getAdmin();
        BaseUserExample example=new BaseUserExample();
        if(admin.getType()==1){
            if(admin.getAgents().size()>0){
                //example.createCriteria().andAgentidIn(admin.getAgents());
            }else{
                example=null;
            }
        }
        List<BaseUser> list=baseUserService.selectByExampleWithPageable(example,pageable);
        if(list.size()>0){
            for(BaseUser user:list){
                BaseUserRoleExample example1=new BaseUserRoleExample();
                example1.createCriteria().andUseridEqualTo(user.getId()).andRidEqualTo(19);
                List<BaseUserRole> userRoles1=baseUserRoleService.selectByExample(example1);
                if(userRoles1.size()>0){
                    BaseRole role=baseRoleService.selectByPrimaryKey(userRoles1.get(0).getRid());
                    user.setrName(role.getRname());
                    user.setRid(role.getRid());
                }else{
                    list.remove(user);
                }
            }
        }
        Integer total=baseUserService.countByExample(example);
        Map<Object,Object> map=new HashMap<Object, Object>();
        map.put("list",list);
        map.put("total",total);
        return Result.ok(null,map);
    }

    */
/**
     * 城市经理列表
     *//*

   */
/* @GetMapping("/select")
    //@RequiresPermissions("server:goodsSellType:select")
    public Result select(){
        List<RunfastGoodsSellType> list = runfastGoodsSellTypeService.selectByExample(null);
        return Result.ok(null,list);
    }*//*


    */
/**
     * 保存城市经理
     *//*

    @PostMapping("/save")
    public Result save(BaseUser user){
        user.setCreatetime(new Date());
        baseUserService.insertSelective(user);
        return Result.ok(null);
    }

    */
/**
     * 修改城市经理
     *//*

    @PostMapping("/update")
    public Result update(BaseUser user){
        user.setModifytime(new Date());
        baseUserService.updateByPrimaryKeySelective(user);
        return Result.ok(null);
    }

    */
/**
     * 删除城市经理---暂时不实现
     *//*

    */
/*@PostMapping("/delete")
    public R delete(@RequestBody Long[] roleIds){
        sysRoleService.deleteBatch(roleIds);

        return R.ok();
    }*//*





    */
/**
     * 城市经理列表
     *//*

    @GetMapping("/cityManagerlist")
    public Result cityManagerlist(@PageableDefault Pageable pageable, Map<String, Object> params){
        */
/*BaseUser admin = SessionContext.getAdmin();
        BaseUserExample example=new BaseUserExample();
        if(admin.getType()==1){
            if(admin.getAgents().size()>0){
                //example.createCriteria().andAgentidIn(admin.getAgents());
            }else{
                example=null;
            }
        }*//*

        //List<BaseUser> userList=baseUserService.selectUserByExampleWithPageable();
        //Integer total=baseUserService.countByExample(example);
        Map<Object,Object> map=new HashMap<Object, Object>();
        //map.put("list",userList);
        //map.put("total",total);
        return Result.ok(null,map);
    }


}
*/
